#include "Infrared.h"
#include "InfraredConfig.h"

void Infrared_init()
{
    GPIO_Init(Infrared_Receive_Port, Infrared_Receive_Pin, GPIO_MODE_IN_HI);
    GPIO_Init(Infrared_Send_Port, Infrared_Send_Pin, GPIO_MODE_OUT_PP);
    GPIO_WriteHigh(Infrared_Send_Port, Infrared_Send_Pin);
}

bool Infrared_state()
{
    bool state;
    state = GPIO_ReadPin(Infrared_Receive_Port, Infrared_Receive_Pin)?true:false;
    // GPIO_WriteLow(Infrared_Send_Port, Infrared_Send_Pin);
    return state;
}
